
public class SimpleLogger
{
  /**
    * A main, but just for now.
    */
  public static void main(String[] args) {

    if (args.length < 3)
    {
      System.out.println("Usage: java SimpleLogger <LogDirName> <bGeigieSerialPort> [<GPSSerialPort> <writeTimeIntervalInSeconds]");
      System.exit(-1);
    }

    /* get write interval */
    int wi = 5000;
    try
    {
      wi = 1000*Integer.parseInt(args[2]);
    } catch (NumberFormatException nfe) {
      System.out.println("Please enter proper number for log write interval.");
      System.exit(-1);
    }

    /* create logger */
    Logger logger = new Logger(wi, args[0]);

    /* connect serial ports */
    if (!logger.connect(args[1]))
    {
      System.out.println("Couldn't connect all devices. Exiting.");
      System.exit(-1);
    }

    /* start logging */
    logger.start();

    /* delay 20 seconds for the win */
    try {
      Thread.sleep(22000);
    } catch (InterruptedException ie) {
      System.out.println("Interrupted LAUL");
    }

    /* stop the counter */
    logger.stop();

    /* disconnect devices */

  } 


}
